\chapter{Part B}

\section{Write an XSLT 2.0 stylesheet that transforms a WikiXML document into the non-XML syntax}

The stylesheet performing the transformation is called \texttt{WikiXML2Txt.xsl}, and the implementation is pretty straightforward. First the \texttt{<template match=w:wiki/>} is making the resulting \texttt{.txt} document recursively. This template is applying all the other templates in the WikiXML language. %The transformation from \texttt{txt} to \texttt{WikiXML} is suppose to be the identity function.

The stylesheet dosn't, however, take care of the fact that you can nest a bold tag inside a italics tag. For enstance the sequence \texttt{<italics> <bold> <word> italicsbold </word> </bold> </italics>} will result in the wiki syntax \texttt{''''' italicsbold ''''' }. This, of course, makes no sense. But the \texttt{WikiXML} tranformer dosn't make that kind of syntax, and therefor this will never happend.

Another note on the Stylesheet is the handling of special \texttt{character}s. The \texttt{character} has one attribute, \texttt{entity}. This attribute cointains the code for the special character.



\section{Write an XSLT 2.0 stylesheet that transforms a WikiXML document into a valid XHMTL presentation}
%Notice that the handling of wikilink elements depends on your solutions to later parts of the project.
%You are free to decide the exact look and style of the genrated pages as you wish.

As with \texttt{WikiXML2Txt.xsl}, the implementation of the stylesheet \texttt{WikiXML2XHTML.xsl} is with a few exceptions pretty much straightforward. The first template maches the root, and then the other templates is  applied recursively. The templates applied then uses basic \texttt{XHTML} syntax. There are a few places where some of the optional attributes require some more advanced \texttt{XSLT} features, eg. the wikilink elements have an optional wiki attribute that has to be taken in account with an \texttt{<xsi:if} statement when producing the \texttt{XHTML} code. 

\section{Describe challenges you have encountered writing the transformations and choices you have made} 

Both implementations were very basic and dosn't cointain much tweaking. 

